![]() |
|
Some of our instruments (DI-720, DI-730, DI-740, DI-500, DI-510, DI-5001, DI-78x only) have the unique capability of allowing analog and digital I/O data to be written or acquired at a different rate per channel. This feature is possible through the use of a counter attached to each input and output scan list element (a total of 272 counters exist). The number loaded into the counter defines the rate at which that scan element will read or write data according to the following equation:
Where:
S = desired sampling rate of the input list entry
B = burst rate of the instrument
L = length of the input or output list (whichever is greater)
C = “count weight” or input counter list entry (the value represented by i in the command format).
The effect of counter values on the placement of data in the input and output buffers is significant, and deserves special treatment. We will examine the use of data buffers in this special case by applying several examples of analog input operations at varying rates per channel.
To keep the examples manageable, we will set the burst rate at 1000 samples per second, and fix the length of the scan list to four elements. In practice, you would want to set the burst rate as high as possible to minimize time skew between channels. Setting a lower burst rate for the sake of the example, however, allows a small change in the counter value to translate into a large change in sample rate. The length of the input buffer will also be fixed at twenty samples.
We will look at three examples: The first will set the counter value to zero for all four channels; the second will apply the same, but non-zero counter value to all channels; the third will apply a different counter value per channel.
This is the most common operating mode of data acquisition products where the sample throughput rate of the instrument is divided equally among the enabled channels. In our example of a burst rate of 1000Hz and four enabled channels, each channel is sampled at a rate of 250Hz.
Channel Number | Counter Value | Sample Rate (Hz) |
0 | 0 | 250 |
1 | 0 | 250 |
2 | 0 | 250 |
3 | 0 | 250 |
When executed, A/D values will appear in the input buffer in the order of lowest to highest as follows:
Input Buffer Position | Acquired Channel # |
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 0 |
5 | 1 |
6 | 2 |
7 | 3 |
8 | 0 |
9 | 1 |
10 | 2 |
11 | 3 |
12 | 0 |
13 | 1 |
14 | 2 |
15 | 3 |
16 | 0 |
17 | 1 |
18 | 2 |
19 | 3 |
All instruments sample A/D data in the burst mode of operation. In the example we’ve defined above, five bursts of A/D conversions result in a total of twenty samples delivered to the input buffer as follows:
Burst Number | Channel Number | |||
0 | 1 | 2 | 3 | |
1 | × | × | × | × |
2 | × | × | × | × |
3 | × | × | × | × |
4 | × | × | × | × |
5 | × | × | × | × |
× means the indicated channel number was acquired during the burst
Adjusting counter values to equal but non-zero values has the effect of simply adjusting the sample rate at which the analog data is acquired. For example, setting the counter value to three has the following effect on sample rates...
Channel Number | Counter Value | Sample Rate (Hz) |
0 | 3 | 62.5 |
1 | 3 | 62.5 |
2 | 3 | 62.5 |
3 | 3 | 62.5 |
…but does not affect the order in which channel data is stored in the input buffer:
Input Buffer Position | Acquired Channel # |
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 0 |
5 | 1 |
6 | 2 |
7 | 3 |
8 | 0 |
9 | 1 |
10 | 2 |
11 | 3 |
12 | 0 |
13 | 1 |
14 | 2 |
15 | 3 |
16 | 0 |
17 | 1 |
18 | 2 |
19 | 3 |
However, looking at how the data is acquired in relation to the burst number shows a clearly slower sample rate. The burst rate is fixed at 1000Hz and the counters are decremented at that rate. When a counter passes through zero, a sample is acquired for that channel, the counter is reset to its initial value (3 in this example), and data acquisition resumes. Since the counters for all channels are set to the same value, sampling occurs for each on the same burst number.
Burst Number | Channel Number | |||
0 | 1 | 2 | 3 | |
1 | ||||
2 | ||||
3 | ||||
4 | × | × | × | × |
5 | ||||
6 | ||||
7 | ||||
8 | × | × | × | × |
9 | ||||
10 | ||||
11 | ||||
12 | × | × | × | × |
13 | ||||
14 | ||||
15 | ||||
16 | × | × | × | × |
17 | ||||
18 | ||||
19 | ||||
20 | × | × | × | × |
× means the indicated channel number was acquired during the burst
So far, there has been little differentiation from other alternative products regarding sample rate selection. But with the ability to apply a different count value per element, the sample rate of each channel may vary. This adds significant flexibility to your data acquisition tasks. Selecting a count value of 0, 1, 2, and 3 to channels 0 through 3 respectively yields the following sample rates per channel:
Channel Number | Counter Value | Sample Rate (Hz) |
0 | 0 | 250 |
1 | 1 | 125 |
2 | 2 | 83.33 |
3 | 3 | 62.5 |
When acquired, the order of channels appearing in our 20-sample input buffer is as follows:
Input Buffer Position | Acquired Channel # |
0 | 0 |
1 | 0 |
2 | 1 |
3 | 0 |
4 | 2 |
5 | 0 |
6 | 1 |
7 | 3 |
8 | 0 |
9 | 0 |
10 | 1 |
11 | 2 |
12 | 0 |
13 | 0 |
14 | 1 |
15 | 3 |
16 | 0 |
17 | 2 |
18 | 0 |
19 | 1 |
When broken down by burst sample number, the following scan order is revealed. Clearly demonstrating the varying sample rates per acquired channel:
Burst Number | Channel Number | |||
0 | 1 | 2 | 3 | |
1 | × | |||
2 | × | × | ||
3 | × | × | ||
4 | × | × | × | |
5 | × | |||
6 | × | × | × | |
7 | × | |||
8 | × | × | × | |
9 | × | × | ||
10 | × | × |
× means the indicated channel number was acquired during the burst
Note also by examining the above table that the number of burst numbers separating each acquisition of a particular channel is constant. This means that each sample of any channel occurs at a precise and predictable moment in time.
Copyright © DATAQ Instruments, Inc.